import {
	validatenull
} from '_c/utils/validate'

/**
 * localStorage 的过期时间,单位毫秒 30天
 */
const localStorageExpires = 2592000000

/**
 * 存储localStorage
 */
export const setStore = (key, value) => {
	uni.setStorageSync(key, JSON.stringify(value))
}
/**
 * 获取localStorage
 */

export const getStore = (key) => {
	let value = uni.getStorageSync(key) || '';
	if (value) {
		value = JSON.parse(value)
	}
	return value
}
/**
 * 删除localStorage
 */
export const removeStore = (key) => {
	uni.removeStorageSync(key);
}

/**
 * 清空全部localStorage
 */
export const clearStore = () => {
	uni.clearStorageSync();
}
